local daofeng = fk.CreateSkill({
    name = "sj7__daofeng",
  })
  
  Fk:loadTranslationTable{
    ["sj7__daofeng"] = "蹈锋",
    [":sj7__daofeng"] = "出牌阶段限一次，你可以视为使用一张改为打出由你选择的一种基本牌的【决斗】；若你因此受到伤害则你可以视为使用一张你选择的牌。",

    ["sj7__daofeng_use"] = "蹈锋",
    ["#sj7__daofeng"] = "蹈锋：你可以视为使用一张改为打出由你选择的一种基本牌的【决斗】",
    ["#sj7__daofeng_ask"] = "蹈锋：请打出一张【%arg】",
  
   ["$sj7__daofeng1"] = "",
   ["$sj7__daofeng2"] = "",
  }

  local U = require "packages.utility.utility"

  daofeng:addEffect("active", {
    prompt = "#sj7__daofeng",
    interaction = function (self, player)
      return UI.CardNameBox {
        choices = Fk:getAllCardNames("b",true)
      }
    end,
   can_use = function(self, player)
     return player:usedSkillTimes(daofeng.name, Player.HistoryPhase) < 1
   end,
   card_filter = Util.FalseFunc,
   target_filter = Util.FalseFunc,
   on_use = function(self, room, effect)
     local player = effect.from
     local use = room:askToUseVirtualCard(player,{
      name = "duel",
      skill_name = daofeng.name,
      skip = true,
     })
     if use then
      use.extra_data = use.extra_data or {}
      use.extra_data.sj7__daofeng = self.interaction.data
      room:useCard(use)
     end
   end,
  })

  daofeng:addEffect(fk.AskForCardResponse, {
    can_refresh = function(self, event, target, player, data)
      return data.eventData and data.eventData.card.skillName == daofeng.name and target == player
  end,
    on_refresh = function(self, event, target, player, data)
      local room = player.room
      data.eventData.extra_data = data.eventData.extra_data or {}
      data.extraData = data.extraData or {}
      if data.eventData.extra_data.sj7__daofeng ~= "slash" and not data.extraData.sj7__daofeng_response then
        local params = { ---@type AskToUseCardParams
        skill_name = data.eventData.extra_data.sj7__daofeng,
        pattern = data.eventData.extra_data.sj7__daofeng,
        cancelable = true,
        event_data = data.eventData,
        prompt = "#sj7__daofeng_ask:::"..data.eventData.extra_data.sj7__daofeng,
        extra_data = {sj7__daofeng_response = true}
        }
        local respond = room:askToResponse(player, params)
        data.result = respond and respond or true
      end
    end,
  })

  daofeng:addEffect(fk.Damaged, {
    is_delay_effect = true,
    can_trigger = function(self, event, target, player, data)
      return player:hasSkill(daofeng.name) and target == player and data.card and data.card.skillName == daofeng.name
    end,
    on_cost = function (self, event, target, player, data)
      local room = player.room
      local use = room.logic:getCurrentEvent():findParent(GameEvent.UseCard).data
      use.extra_data = use.extra_data or {}
      local u = room:askToUseVirtualCard(player,{
        name = use.extra_data.sj7__daofeng,
        skill_name = "sj7__daofeng_use",
        skip = true,
       })
      if u then
        event:setCostData(self,{use = u})
        return true
      end
    end,
    on_use = function (self, event, target, player, data)
      player.room:useCard(event:getCostData(self).use)
    end,
  })


  return daofeng